<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>材料供货商供货单核对</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="../../../resources/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../resources/css/style.css" media="all">
    <style>
        /*.layui-form-pane .layui-input-block{margin-left: 82px;}*/
        .saixuan:after{width: 0;}
        .layui-form-pane .layui-input-block{margin-left: 0;}


        .layui-form-item .layui-input-inline{width: 165px;}
        .masksx .forms{padding-left: 0;text-align: center;}
        .masksx{width:470px;}
        .mask input{width: 100%!important;}
        .mask .layui-select-title{width: 480px;}
        .layui-inline{margin-bottom: 10px;}
        .layui-upload{ text-align: left;}
        #demo2 img{width: 120px; height: 120px;}
        .imgs{position: relative;width: 120px; height: 120px; float: left;}
        ._ingshan{position: absolute;right: 0px;top: 0px;border: 1px solid #E3e3e3;
            border-radius: 50%;width: 20px;height: 20px;text-align: center;}
        @media only screen and (min-width: 321px) and (max-width: 1024px) {
            .layui-form-pane .layui-form-label{width: 108px;}
            .layui-input-inline{width: 100%;}
            .mask .layui-input-inline{width:auto;}
            .layui-form-item .layui-input-inline{width: 100%;}
        }
        .chakan{display: none;}
        .chakan input{width: 83%!important;}
        .dynamic li:before{content: "";}
        .dynamic{text-align: left;}
        .dynamic li{padding-left: 40px; height: 30px;line-height: 30px;}
        .GLeft{width: 100px;display: inline-block;}
    </style>
</head>
<body>
<form class="layui-form layui-form-pane" id="form_7grid" action="" >
    <div class="formTop layui-row">
        <div class="layui-form-item layui-col-lg2 layui-col-md2  layui-col-xs6">
            <div class="layui-input-inline">
                <input type="text" name="cc_code"  placeholder="项目名称" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline layui-col-lg2 layui-col-md2 layui-col-xs6">
            <div class="layui-input-inline">
                <input type="text" class="layui-input" id="test-limit3" placeholder="请选择开始日期">
                <div class="icons">

                </div>
            </div>
        </div>
        <div class="layui-inline layui-col-l2 layui-col-md2 layui-col-xs6">
            <div class="layui-input-inline">
                <input type="text" class="layui-input" id="test-limit4" placeholder="请选择结束日期">
                <div class="icons">

                </div>
            </div>
        </div>
        <div class="layui-inline layui-col-lg3 layui-col-md3 layui-col-xs6">

            <div class="layui-input-block">
                <select name="state" lay-filter="aihao">
                    <option value="" selected="">请选择审核状态</option>
                    <option value="0">签收完成</option>
                    <option value="-1">签收未完成</option>
                </select>
            </div>
        </div>
        <div class="layui-col-lg3 layui-col-md3 layui-col-xs12">
            <button class="layui-btn" type="button" onclick="query()" style="float: right;">查询
            </button>
        </div>

    </div>

    <table id="demo" lay-filter="test"></table>

    <div id="demo7"></div>
    <a class="dayin" type="button" id="dlink"  style="float: right; position: fixed; right: 50px; bottom: 50px; z-index: 999;"></a>
    <script type="text/html" id="barDemo">

        <a class="layui-btn layui-btn-sm" lay-event="toExamine">查看</a>
    </script>

    <div class="mask">
        <div class="masksx">
            <div class="title"><span class="titleL">申请签证</span><span class="close">×</span></div>
            <div class="forms shenqing">
                <form class="layui-form addUser" method="post" action="">
                    <div class="layui-inline">
                        <label class="layui-form-label">合同号:</label>
                        <div class="layui-input-inline">
                            <select name="modules" lay-verify="required" lay-search="">
                                <option value="">直接选择或搜索选择</option>
                                <option value="1">layer</option>


                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">工程名称:</label>
                        <div class="layui-input-inline">
                            <select name="modules" lay-verify="required" lay-search="">
                                <option value="">直接选择或搜索选择</option>
                                <option value="1">layer</option>


                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">签证人:</label>
                        <div class="layui-input-inline">
                            <select name="modules" lay-verify="required" lay-search="">
                                <option value="">直接选择或搜索选择</option>
                                <option value="1">layer</option>


                            </select>
                        </div>
                    </div>


                    <div class="_submit">
                        <button class="layui-btn layui-btn-sm tijiao" lay-submit lay-filter="_subm">提交</button>
                        <button class="layui-btn layui-btn-sm " type="reset">重置</button>
                    </div>

                </form>

            </div>
            <div class="forms chakan">
                <form class="layui-form addUser" method="post" action="">
                    <ul class="dynamic">
                        <li>
                            <p><span class="GLeft">合同编号</span><span class="GRight cc_Code">CCD551</span></p>
                        </li>
                        <li>
                            <p><span class="GLeft">项目名称</span><span class="GRight eppName"></span></p>
                        </li>
                        <li>
                            <p><span class="GLeft">上报时间</span><span class="GRight createTime"></span></p>
                        </li>
                        <li>
                            <p><span class="GLeft">施工单位</span><span class="GRight compName1"></span></p>
                        </li>

                    </ul>
                </form>
            </div>
        </div>
    </div>



</form>

<script src="../../../resources/layui/layui.js" charset="utf-8"></script>
<script src="../../../resources/js/style.js"></script>
<script src="../../../resources/js/api.js"></script>

<script>
    function query() {
        layui.use(['form', 'layedit', 'laydate','table','element','upload'], function() {
            var form = layui.form
                , table = layui.table
                ,upload = layui.upload;
            var pronName=$("[name='username']").val();      //获取查询值
            var begintime=$('#test-limit3').val();          //获取查询开始时间
            var endtime=$('#test-limit4').val();            //获取查询结束时间
            var state=$('[name="state"]').val();         //获取状态值

            $('#form_7grid').attr('action',urls+'/api/contract/conValiList.do')
            if(!AntiSqlValid(pronName)){           //判断是否包含特殊符号
                API.managecaihedui({'proName':pronName,'begintime':begintime,'endtime':endtime,'state':state,'p':getCookie('yanzheng')})
            }else {
                layer.msg('请勿输入特殊符号');
            };
        })

    }
    layui.use(['form', 'layedit', 'laydate','table','element','upload'], function(){
        var form = layui.form
            ,layer = layui.layer
            ,layedit = layui.layedit
            ,laydate = layui.laydate
            ,table=layui.table
            ,element=layui.element
            ,upload = layui.upload;
        var _picurls=new Array();
        jiazais();

        $('.demoTable .layui-btn').on('click', function(){
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';        //代替另一个对象调用一个方法。call 方法可将一个函数的对象上下文从初始的上下文改变为由 thisObj 指定的新对象。
        });
        API.managecaihedui({'p':getCookie('yanzheng')});

        //前后若干天可选，这里设置不能选过去的日期      最远可选1000天之后
        panduanshijiantow('#test-limit3','#test-limit4',1000,1000,'.layui-btn-normal');     //查询 开始结束时间判断

        $('.shenqingvisa').click(function () {
            $('.mask').show();
        })

        $('.close').click(function () {     //遮罩层隐藏
            $('.mask').hide();
        })
        dayintishi('.dayin');

        //监听工具条
        table.on('tool(test)', function(obj){ //注：tool是工具条事件名，test是table原始容器的属性 lay-filter="对应的值"
            var data = obj.data; //获得当前行数据
            var layEvent = obj.event; //获得 lay-event 对应的值
            var tr = obj.tr; //获得当前行 tr 的DOM对象

            if(layEvent === 'detail'){ //查看
                //do somehing
                //console.log(obj)

            }else if( layEvent==='toExamine'){      //编辑
                $('.titleL').html('查看详情');
                //console.log(obj)
                $('.cc_Code').html(obj.data.cc_Code);
                $('.eppName').html(obj.data.proName);
                $('.createTime').html(obj.data.createTime);
                $('.compName1').html(obj.data.compName1);
                for(var key in obj.data){               //for in 循环对象获取键值
                    var str = /[\u4e00-\u9fa5]/;          //正则 匹配汉字
                    if(str.test(key)){                     //如果键是汉字  动态添加元素
                        $('.dynamic').append(' <li>\n' +
                            '                            <p><span class="GLeft">'+key+'</span><span class="GRight compName1">'+obj.data[key]+'</span></p>\n' +
                            '                        </li>')
                    }

                }



                $('.chakan').show();
                $('.shenqing').hide();
                $('.mask').show();

            }
        });



        $(document).on('click','._ingshan',function () {
            //console.log($(this).prev().attr('src'))
            var shanSRC=$(this).prev().attr('src');
            $(this).parent().remove();
            $.each(_picurls,function(index,item){       //删除功能
                // index是索引值（即下标）   item是每次遍历得到的值；
                if(item==shanSRC){
                    _picurls.splice(index,1);
                }

            });

            //console.log(_picurls)
        })


    })

</script>
</body>
</html>